<template>
  <t-dialog
    header="摘要(主要研究内容)"
    :visible.sync="visible"
    :onClose="closeDialog"
    :closeOnOverlayClick="false"
    :confirmBtn="null"
    width="80%"
    top="5%"
  >
    <div style="height: 65vh">
      <inner-html :content="digest"></inner-html>
    </div>
  </t-dialog>
</template>

<script>
// import TinyMceEditor from "@/components/TinyMceEditor/index.vue";
import innerHtml from "../../../../components/InnerHtml/index.vue";

export default {
  name: "project-digest-dialog",
  components:{
    // TinyMceEditor
    innerHtml
  },
  props:{
    header:{
      type: String,
      default: '',
    },
    objId:{
      type: Number,
      default: 0
    },
  },
  data(){
    return {
      visible: true,
      digest: '',
    }
  },
  watch: {
    objId: {
      immediate: true,
      handler(val) {
        if (val) {
          this.getObj();
        }
      }
    },
  },
  methods:{
    getObj() {
      if(this.objId){
        this.$api.kjxm.project.getDigestById(this.objId).then(response => {
          this.digest = response.data.digest;
        }).catch((e) => {
          this.$message.error(e.toString());
        });
      }
    },
    closeDialog() {
      this.$emit("update:visible", false);
    },
  }
}
</script>

<style scoped>

</style>
